<h2>Evento</h2>
<fieldset>
  <p class="clearfix stub"><label for="title">Título</label> <span>Ej: Cena con los primos; Cumpleaños de Cristina<br/></span>
  <%= f.text_field(:title, :class => 'textfield bigfield') %></p>

  <p class="clearfix stub"><label for="description">Notas</label> <span>Una descripción del evento<br/></span>
  <%= f.text_area(:description, :class => 'textfield') %></p>

  <p class="clearfix stub"><label for="tags">Tags</label> <span>Ej: cena, cumpleaños, partidillo<br/></span>
  <%= text_field(:tag_list, '', :class => 'textfield') %></p>
  
  <p class="clearfix stub">
    <%= f.check_box(:private) %>
    <label for="title">Privado</label> <span>Sólo tú y tus invitados podéis verlo.</span>
  </p>
  
</fieldset>
  
  <h2>Cuando</h2>
  <fieldset>
    <div class="clearfix stub">
      
      <p class="selectdate">
        <label for="starts_at">Selecciona un día</label><br/>
        <%= calendar_date_select :event_time, :starts_at, :embedded => false, :time => false  %>
      </p>
      <p class="selectdate">
        <label for="starts_at">¿A qué hora empieza?</label><br/>
        <%= select_hour(Time.now, :prefix => "event_time", :field_name => 'starts_at(4i)', :ampm => true) %>
         : 
        <%= select_minute(Time.now, :prefix => "event_time", :field_name => 'starts_at(5i)', :minute_step => 5) %>            
      </p>
      <div class="separata"></div>
      
      <%= check_box_tag 'has_ends_date', '1', @event.ends_at.nil? ? false : true , {:onclick => "ends_date_layer(this.checked); locate_div('place_operations'); "}%> <label for="has_ends_date">Seleccionar una fecha de fin</label>
      
      <div id="ends_at_select" style="<%= "display:none" if @event.ends_at.nil? %>">
        <p class="selectdate">
          <label for="ends_at">Selecciona un día</label><br/>
          <%= calendar_date_select :event_time, :ends_at, :embedded => false, :time => false  %>
        </p>
      
        <p class="selectdate">
          <label for="ends_at">¿A qué hora termina?</label><br/>
          <%= select_hour(Time.now, :prefix => "event_time", :field_name => 'ends_at(4i)', :ampm => true) %>
           : 
          <%= select_minute(Time.now, :prefix => "event_time", :field_name => 'ends_at(5i)', :minute_step => 5) %>            
        </p>
      </div>
    </div>
  </fieldset>
    
  <h2>Dónde</h2>
  <fieldset>
    <div id="places_select">
    <% if current_user.places.size > 0 %>
          <%= render :partial => 'places_select'%>
    <% else %>
      <p><strong>Todavía no has creado ningún lugar: <%= link_to_remote 'crea uno ahora mismo', :url => {:controller => 'places', :action => 'new'}, :loading => "$('loadplace').show();", :complete => "$('loadplace').hide(); locate_div('place_operations'); initialize_map();", :html => {:href => url_for(:controller => 'places', :action => 'new') } %>.</strong></p>
    <% end %>
    </div>
    <%= image_tag 'ajaxload.gif', {:id => 'loadplace', :style => "display:none"} %>
    <div id="place_operations_locator"></div>
  </fieldset>
  
  <%= f.hidden_field :user_id, :value => current_user.id %>